-- Add new int field
IF NOT EXISTS(SELECT [Name] FROM syscolumns WHERE Name = 'SalePrice' AND ID = OBJECT_ID('dbo.ReturnProductDetail'))
   ALTER TABLE ReturnProductDetail ADD SalePrice INT NULL
   
IF NOT EXISTS(SELECT [Name] FROM syscolumns WHERE Name = 'SaleTime' AND ID = OBJECT_ID('dbo.ReturnProductDetail'))
   ALTER TABLE ReturnProductDetail ADD SaleTime DATETIME NULL
   
IF NOT EXISTS(SELECT [Name] FROM syscolumns WHERE Name = 'BillDetailId' AND ID = OBJECT_ID('dbo.ReturnProductDetail'))
   ALTER TABLE ReturnProductDetail ADD BillDetailId INT NULL
   
ALTER TABLE dbo.ReturnProductDetail
ADD CONSTRAINT rfk_ReturnProductDetail_BillDetail_BillDetailId FOREIGN KEY
	( BillDetailId ) 
REFERENCES dbo.BillDetail
	( Id )